﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;

namespace ATM
{
    public partial class Log_In : Form
    {
       // AccountDB logg = new AccountDB();
        AccountLogic ca = new AccountLogic();

        public string x, y;
        public Log_In()
        {
            InitializeComponent();
            result.PasswordChar = '*';
            result.MaxLength=12;
        }

        private void button_Click(object sender, EventArgs e)
        {
            Button b = (Button)sender;
            result.Text = result.Text + b.Text;
        }

        private void button1_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click_1(object sender, EventArgs e)// log in
        {
            y = this.result.Text;
            ca.calllog(y);
            if (ca.ch == 1)
            {
                if (ca.check == 1)
                {
                    inter_face inter = new inter_face(y);
                    inter.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Uncorrect Account Number !!");
                    result.Clear();

                }
            }
            else
            {
                MessageBox.Show("It must be a positive Numeric value");
                result.Clear();
            }



        }

        private void result_TextChanged(object sender, EventArgs e)
        {

        }

        private void button12_Click(object sender, EventArgs e)
        {
            result.Clear();
        }

        private void button13_Click(object sender, EventArgs e)
        {
            welcom w = new welcom();
            w.Show();
            this.Hide();
        }

    }
}
